public class PlayerAIState_Offense_FreeThrow : State<PlayerAI>
{
	public static PlayerAIState_Offense_FreeThrow instance;

	private PlayerAIState_Offense_FreeThrow()
	{
	}

	public static PlayerAIState_Offense_FreeThrow getInstance()
	{
		if (instance == null)
		{
			instance = new PlayerAIState_Offense_FreeThrow();
		}
		return instance;
	}

	public override void enter(PlayerAI owner)
	{
		base.enter(owner);
		if (owner.player.teamType == TeamType.COMPUTER && Instance<Ball>.instance.IsInvoking("reStartGame"))
		{
			Instance<Ball>.instance.isInvokeingRestartGame = false;
			Instance<Ball>.instance.CancelInvoke();
		}
		owner.time_Stop = 0f;
		owner.freethrow_isHandAnimation = MathHelper.isInPercent(50f);
	}

	public override void fixedUpdate(PlayerAI owner)
	{
		base.fixedUpdate(owner);
		if (GameHelper.MoveTo(owner.player, owner.freethrow_pos, owner.player.getMoveSpeed(), isLookAtTargetPos: true))
		{
			if (owner.player.isInState(PlayerStateBehavior_Run.getInstance()))
			{
				Instance<Court>.instance.count_ReadyToFreeThrow++;
			}
			if (owner.player.teamType == TeamType.USER)
			{
				owner.player.do_idle();
			}
			else if (!owner.player.isInState(PlayerStateBehavior_FreeThrow.getInstance()))
			{
				owner.player.do_idle();
			}
			owner.player.LookAt(owner.freethrow_direction);
			if (owner.freethrow_isHandAnimation)
			{
				owner.player.playAnimation(AnimationName.player_idle_freethrow, 1f, 0.8f);
			}
			if (owner.player == Instance<Ball>.instance.shoot_player && owner.player.teamType != TeamType.COMPUTER)
			{
				owner.player.team.setIsAllAI(_isAllAI: false);
			}
		}
		else
		{
			owner.player.do_run();
		}
	}
}
